// 括号问题 解题思路，用栈来解决


function validParenteses(s) {
    if (!s ) {
        return true
    }
    
    if (s.length % 2 === 1) {
        return false;
    }
    let stack = []
    let dict = {
        '(': ")",
        '[': "]",
        "{": "}"
    }
    for (let i = 0; i < s.length; i++) {
        let stackTop = stack[stack.length - 1];
        if (dict[stackTop] === s.charAt(i)) {
            stack.pop()
        } else {
            stack.push(s.charAt(i))
        }
    }
    return stack.length === 0
}

function validParenteses(params) {
    while (true) {
        let len = s.length;
        s = s.replace('()', '');
        s = s.replace('{}', '');
        s = s.replace('[]', '');
        if (s.length === len){
            return len === 0;
        }
      }
}